<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>mergeProps</title>
</head>
<body>
  <div id="app">
    <div :class="obj.class" >
      <button @click="obj.onClick">点击</button>
    </div>
  </div>
</body>
<script src="../lib/vue.global.js"></script>
<script>
  const { createApp, mergeProps } = Vue
  // onclick 覆盖
  // onClick 合并
  const one = {
    class: 'a',
    onClick: () => { console.log(1)}
  } 

  const two = {
    class: { b: true },
    onClick: () => { console.log(2)}
  }

  const obj = mergeProps(one, two)
  console.log(obj)
  createApp({
    data () {
      return {
        obj
      }
    }
  }).mount('#app')
</script>
</html>